{% extends myBundleName ~ ':Layout:layout.html.twig' %}

{% block title %}{{ myTitlePrefix }} Team Schedule {% endblock %}

{% block content %}
{% include myBundleName ~ ':Schedule:Search/team.html.twig' %}
<div>
    <table border="1" style="max-width: 850px;">
        <tr><th colspan="7">Team Schedule 2012 - Game Count {{ gameCount }}</th></tr>
        <tr><td colspan="7">PP=Pool Play, QF=Quarter-Final, SF=Semi-Final, CM=Consolation Match, FM=Final Match</td></tr>
        <tr>
            <td>Game</td>
            <td>DOW Time</td>
            <td>Field</td>
            <td>Pool</td>
            <td>Home Team</td>
            <td>Away Teams</td>
        </tr>
        {% for game in games %}
        <tr id="team-sched-{{game.num}}" class="game-status-{{game.status}}">
            <td>
                {{ game.num }}
            </td>
            <td>{{ game_dow(game.date) }} {{ game_time(game.time) }}</td>
            <td>{{ game.fieldDesc          }}</td>
            <td>{{ game.pool               }}</td>
            <td>
                {% set itemClass = game_team_class(teamIds,game.homeTeam.team) %}
                {% if  itemClass %}
                    <span class="{{ itemClass }}">{{ game.homeTeam.team.desc }}</span>
                {% else %}
                    {{ game.homeTeam.team.desc }}
                {% endif %}
            </td>
            <td>
                {% set itemClass = game_team_class(teamIds,game.awayTeam.team) %}
                {% if  itemClass %}
                    <span class="{{ itemClass }}">{{ game.awayTeam.team.desc }}</span>
                {% else %}
                    {{ game.awayTeam.team.desc }}
                {% endif %}
            </td>
        </tr>
        {% endfor %}       
    </table>
</div>
<style>
.team-hilite { color: green; }
</style>
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    {% include 'ZaysoCoreBundle:Layout:zaysocore-js.html.twig' %}

<script>
$(document).ready(function() 
{
    $('input[type=checkbox][name^="teamSchSearch["][name$="][ALL]"]').change(Zayso.checkboxAll);
})
</script>
{% endblock %}